package com.yuntsg.ruiijn.database.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuntsg.ruiijn.database.entity.WosBasic;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * wos文章主体 Mapper 接口
 * </p>
 *
 * @author ZFL
 * @since 2023-06-01
 */
public interface WosBasicMapper extends BaseMapper<WosBasic> {

    @Select("SELECT\n" +
            "\t * \n" +
            "FROM\n" +
            "\twos_basic \n" +
            "WHERE\n" +
            "\tJSON_CONTAINS(\n" +
            "\tfund_list,\n" +
            "\tJSON_ARRAY( #{name} )) limit #{page} , ;")
    List<WosBasic> findByFund(String name, Integer page, Integer limit);


    @Update("UPDATE  wos_basic  SET analysis_map = null ,analysis_flag= 0,au_msg_flag=0,copy_flag = 2 ,file_path = NULL,pdf_url = NULL where id = #{id};")
    void setNull(Integer id);

}
